[PURPOSE]
In the Microsoft SQL server environment of the given relational database management system, lab students can:
1, ms SQL Server understanding and environment familiar, understand the T-SQL of standard SQL expansion.
2. Master the data definition in the T-SQL environment, including database, basic table, view, index definition.
3, master the T-SQL environment data control including data insertion, deletion, modification.
4. Master the data query and various changes in the T-SQL environm
function. The prize winning query module queries the prize winning results. The lottery module controls the reward level, total number of Lottery draws, and number of Lottery draws each time. System Architecture box.
System Architecture
System initialization
The guest registration module contains the list of participants and their respective departments. In the ticket management module, When you click the initialization button, use the internal program design to first clear the last lottery re
as follows:
The following are the referenced contents:
Docmd.setwarnings False
Docmd.openquery "Delete to the prize ticket", Acnormal, Acedit
Docmd.openquery "Append to the Prize Ticket", Acnormal, Acedit
Docmd.setwarnings True
Set QRS = Currentdb.openrecordset ("To the prize Ticket")
Qrs. MoveFirst
i = 1
Do-not-QRS. Eof
Docmd.setwarnings True
Set QRS = Currentdb.openrecordset ("To the prize Ticket")
Qrs. MoveFirst
i = 1
Do-not-QRS. Eof
Qrs. Edit
qrs! ordinal = Int ((211-1) * Rnd)
Qrs! to award number = I
not necessarily true."Example 2.43" continued precedent 2.42 (number s#, course number C #, score G, instructor TN, teacher specialty TS), determine whether two 3NF relationship mode R3={c#,tn},r4={tn,ts} is bcnf.Solution: In the relational pattern R3 has the function dependence c#→tn, the determinant Factor C # is the R3 key;In the relational pattern R4, there is a function dependent tn→ts, and the determining factor TN is the key of R4;R3,R4 all satisfy the definition of bcnf, so the two rela
, defining views, and defining indexes.
The SQL language uses the CREATE TABLE statement Definition to create a basic table, the ALTER TABLE statement to modify the basic table definition, the drop TABLE statement to delete the basic table, and the create index statement to create an index, the drop index statement deletes the index table. The SQL language uses the create view command to create a view. The drop view statement deletes the view.
3. Use SQL statements to create four tables i
Bcnf: If all attributes (including primary and non-primary attributes) of the relational mode R (u, f) do not pass any candidate keywords dependent on R, therefore, relational R belongs to bcnf. Or relational mode R. If each deciding factor contains a keyword (rather than a keyword), then bcnf's relational mode.
For example, the component management relationship model WPE (wno, PNO, Eno, qnt) lists the Warehouse number, accessory number, employee numb
-> DNO. DNO-> SnO does not exist, DNO-> location. Therefore, the key Liao SnO decides to implement the location function by passing the dependency Sno-> location. That is to say, SnO does not directly determine the non-primary attribute location.Solution: the transfer dependency cannot be left in each link mode.Solution: There are two relationships: S (SNO, sname, DNO), D (DNO, dname, location)Note: The outer keyword DNO cannot be found in link S. Otherwise, the relationship is lost.
Bcnf: If al
relationships: S (SNO, sname, DNO), D (DNO, dname, location)Note: The outer keyword DNO cannot be found in link S. Otherwise, the relationship is lost.
Bcnf: If all attributes (including primary and non-primary attributes) of the relational mode R (u, f) do not pass any candidate keywords dependent on R, therefore, relational R belongs to bcnf. Or relational mode R. If each deciding factor contains a keyword (rather than a keyword), then the relational mode of rcnf.For example, the component ma
relationship R is called BCNF. or relational schema R, if each determinant contains keywords (rather than being included by the keyword), then the RCNF relational schema.
Example: Accessory Management Relationship Mode WPE (WNO,PNO,ENO,QNT) Separately table warehouse number, accessory number, employee number, quantity. Have the following conditions
A. A warehouse has multiple employees.
B. A worker works only in one warehouse.
C. One type of acce
that depend on R, then the relationship R is called BCNF. or relational schema R, if each determinant contains keywords (rather than being included by the keyword), then the RCNF relational schema. Example: Accessory Management Relationship Mode WPE (WNO,PNO,ENO,QNT) Separately table warehouse number, accessory number, employee number, quantity. There are the following conditions a. A warehouse has multiple employees. B. A worker works only in one wa
, then the relationship R is called BCNF. or relational schema R, if each determinant contains keywords (rather than being included by the keyword), then the RCNF relational schema.
Example: Accessory Management Relationship Mode WPE (WNO,PNO,ENO,QNT) Separately table warehouse number, accessory number, employee number, quantity. Have the following conditions
A. A warehouse has multiple employees.
B. A worker works only in one warehouse.
C. One type o
relationship R is called BCNF. or relational schema R, if each determinant contains keywords (rather than being included by the keyword), then the RCNF relational schema.
Example: Accessory Management Relationship Mode WPE (WNO,PNO,ENO,QNT) Separately table warehouse number, accessory number, employee number, quantity. Have the following conditions
A. A warehouse has multiple employees.
B. A worker works only in one warehouse.
C. One type of acce
SnO decides to implement the location function by passing the dependency Sno-> location. That is to say, SnO does not directly determine the non-primary attribute location.Solution: the transfer dependency cannot be left in each link mode.Solution: There are two relationships: S (SNO, sname, DNO), D (DNO, dname, location)Note: The outer keyword DNO cannot be found in link S. Otherwise, the relationship is lost.
Bcnf: If all attributes (including primary and non-primary attributes) of the relati
rcnf.
For example, the component management relationship model WPE (wno, PNO, Eno, qnt) lists the Warehouse number, accessory number, employee number, and quantity respectively. The following conditions are met:
A. a warehouse has multiple employees.
B. One employee only works in one warehouse.
C. Special personnel are responsible for one type of accessories in each warehouse, but one person can manage several types of accessories.
D. Parts of the sa
. bcnf also includes the dependency of primary attributes on keys. Bcnf must meet higher requirements than 3nf. If the relational mode R is bcnf, R must be 3nf. Otherwise, it may not be true.
[Example 2.43] continued renewal 2.42 (Student ID s #, course number C #, score g, instructor TN, instructor expertise TS) To determine whether the 3nf relational model R3 = {C #, tn}, r4 = {tn, TS} is bcnf.
Solution: In relational mode R3, functions depend on C # → tn. the determining factor C # is the key
the relational mode of rcnf. For example, the component management relationship model WPE (wno, PNO, Eno, qnt) lists the Warehouse number, accessory number, employee number, and quantity respectively. The following conditions are met: A. a warehouse has multiple employees. B. One employee only works in one warehouse. C. Special personnel are responsible for one type of accessories in each warehouse, but one person can manage several types of acce
. For example, the component management relationship model WPE (wno, PNO, Eno, qnt) lists the Warehouse number, accessory number, employee number, and quantity respectively. A. a warehouse has multiple employees. B. One employee only works in one warehouse. C. Special personnel are responsible for one type of accessories in each warehouse, but one person can manage several types of accessories. D. Parts of the same model can be placed in several wareh
relationship R is called BCNF. or relational schema R, if each determinant contains keywords (rather than being included by the keyword), then the RCNF relational schema.
Example: Accessory Management Relationship Mode WPE (WNO,PNO,ENO,QNT) Separately table warehouse number, accessory number, employee number, quantity. Have the following conditions
A. A warehouse has multiple employees.
B. A worker works only in one warehouse.
C. One type of acce
the reward level, the total draw number, each lottery number control. The system architecture diagram is shown in Figure 1.
Figure 1 System architecture
System Initialization
Guest Registration module has included the list of people to participate in the lottery and the department, in the award management module, when the click of the initialization button through the internal program design first of the last lottery results empty, while using Rnd in the lottery before the list of people rando
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.